package com.itcoon.cloud.framework.security.web.controller;/**
 * @author Athric Yu
 * 2024/12/20
 **/

import com.itcoon.cloud.framework.webmvc.response.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 *
 * @author Athric Yu
 * 2024/12/20
 **/
@Tag(name = "认证")
@RequestMapping("/auth")
@RestController
public class AuthController {

    @Operation(summary = "登录接口", requestBody = @RequestBody(content = {
            @Content(
                    mediaType = MediaType.MULTIPART_FORM_DATA_VALUE,
                    schemaProperties = {
                            @SchemaProperty(name = "username", schema = @Schema(type="string", requiredMode = Schema.RequiredMode.REQUIRED, description = "用户名")),
                            @SchemaProperty(name = "password", schema = @Schema(type="string", requiredMode = Schema.RequiredMode.REQUIRED, description = "密码"))
                    }
            )
    }))
    @PostMapping(value = "login", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
    public ApiResponse<Void> login(){
        return ApiResponse.ok();
    }
}
